Skip to content

added _Complex floating point routines#740

Open
ZERICO2005 wants to merge 2 commits intomasterfrom
complex_crt
Open

added _Complex floating point routines#740
ZERICO2005 wants to merge 2 commits intomasterfrom
complex_crt

Conversation

@ZERICO2005
Copy link
Copy Markdown
Contributor

@ZERICO2005 ZERICO2005 commented Mar 8, 2026

When compiling libcxx 19, I noticed that libcalls to __divsc3 et al were emitted. These follow the C calling convention by default. I have provided a basic C implementation of these complex floating point routines so users will not get a linker error.

Adding these functions also removes the need for the warning that -ffast-math is required when using C99 <complex.h>. I have also added a very basic test to make sure that these complex CRT routines work for at least one input.

The code also works on ez80-clang 15.0.0 so these can be back-ported if needed.
https://godbolt.org/z/daT41YeKP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant